package com.yunshang.shoppingmall.config;
//登录认证类

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

@Configuration
@EnableWebSecurity
public class MyWebSecurityConfig extends WebSecurityConfigurerAdapter {



    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {

    }


    @Override
    protected void configure(HttpSecurity http) throws Exception {
        //super.configure(http);
        //http.csrf().disable();
        http.csrf().ignoringAntMatchers("/addProductData", "/addProduct", "/addProductImgs", "/myAddressEdit", "/wap/userRegister", "/wap/updatePwd", "/wap/loginByPhone", "/wap/openLoginPwd",
                "wap/loginByPwd", "/wap/payByJiFen", "/wap/addressDelete", "/addProduct", "/wap/getProductIndex", "/wap/updatePayPwd", "/wap/loginByPwd ", "/wap/valPayPwd", "/wap/withdrawals",
                "/wap/transferFinace", "/updateGuiGePrice", "/updateProductData", "/uploadImgs", "/upImgGroup", "/upProImg", "/uploadProDetailImg", "/deleteClassify", "/savaEditAdminData", "/addAdmin",
                "/saveAddAdmin", "/saveEditUserNo", "/uploadproductDetailImgs", "/addProductData",
                "/addGuiGeImg", "/addproDetailImgs", "/addGuiGeImgGroup", "/updateClassfyImgs", "/addClassfyImgs", "/wap/sendCodeByPhone", "/wap/checkCode", "/addOrUpdateClassify",
                "/updateGuiGeImgs", "/updateGuiGeGroupImgs", "/updateWithDrawals", "/addGuiGeImgs", "/addGuiGeGroupImgs", "/addGuigeAndPriceByProductId", "/addGuigeAndPriceByProductId"
                , "/download", "buildExcelDocument", "/wap/selectGuiGeById", "/API/Weixin/downOrder", "/readExcel", "/changeProductCart", "/user/addUser","/wap/payOrder","/API/Weixin/upOrder",
                "/wechat/access","/wechat/mu","/wechat/Subscribe","/wechat/ImageMessage","/wechat/TextMessage","/WeChat/JsonMuList","/WeChat/Mu/Add","/WeChat/Mu/AddMu","/WeChat/Mu/Edit","/WeChat/Mu/EditMu","/selectSupplier");

        http.headers().frameOptions().disable();//设置frame不受限制
    }

}
